package com.wmyg.antifake.bean;

import com.wmyg.antifake.message.BillRequest;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 工单基本模型
 * @author wong
 */
@Data
@ToString
@AllArgsConstructor
public class Bill extends PageVo{

    public int getBillId() {
        return billId;
    }

    public void setBillId(int billId) {
        this.billId = billId;
    }

    public int getOperator() {
        return operator;
    }

    public void setOperator(int operator) {
        this.operator = operator;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getCaseId() {
        return caseId;
    }

    public void setCaseId(String caseId) {
        this.caseId = caseId;
    }

    public Date getCreatime() {
        return creatime;
    }

    public void setCreatime(Date creatime) {
        this.creatime = creatime;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String[] getBoxes() {
        return boxes;
    }

    public void setBoxes(String[] boxes) {
        this.boxes = boxes;
    }

    /**
     * 工单号
     */
    private int billId;

    /**
     * 工人ID号
     */
    private int operator;

    /**
     * 设备号
     */
    private String deviceId;

    /**
     * 箱号
     */
    private String caseId;

    /**
     *厂商名称
     */
    private String factoryName;

    /**
     *开始-结束时间
     */
    private String startEndTime;

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    /**
     *结束时间
     */
    private Date endTime;

    public String getStartEndTime() {
        return startEndTime;
    }

    public void setStartEndTime(String startEndTime) {
        this.startEndTime = startEndTime;
    }

    public Integer getFactoryId() {
        return factoryId;
    }

    public void setFactoryId(Integer factoryId) {
        this.factoryId = factoryId;
    }

    private Integer factoryId;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date creatime;

    private Integer state;

    private String[] boxes;

    public String getFactoryName() {
        return factoryName;
    }

    public void setFactoryName(String factoryName) {
        this.factoryName = factoryName;
    }

    public Bill(BillRequest billRequest) {
        this.operator = billRequest.getOperator();
        this.deviceId = billRequest.getDeviceId();
        this.caseId = billRequest.getCaseId();
        this.boxes = billRequest.getBoxes();
    }

}
